/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package java1;

/**
 *
 * @author Yu
 */
import java.io.*;
public class IO5 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
	try(FileOutputStream fout =new  FileOutputStream("data3.txt");
		OutputStreamWriter osw =new OutputStreamWriter( fout,"MS950");   //指定為ms950字型
		PrintWriter pw=new PrintWriter(osw); ) {
                    pw.println("中文字");
	pw.println("Hello  Yu   IO5");
	
       }catch(Exception e){
            e.printStackTrace();
        }
	
	
    }
    
}
